import {mapGetters} from 'vuex'
export default {
	computed: {
		...mapGetters('m_cart', ['total'])
	},
	watch: {
		total(){
			this.setBadge()
		}
	},
	onShow() {
		this.setBadge()
	},
	
	methods:{
		setBadge(){
		wx.setTabBarBadge({
			index:1,
			//字符串形式
			text:`${this.total}`
		})
		}
	}
}